<template>
  <a-input v-model:value="value" @change="change" />
</template>

<script>
import { reactive, toRefs } from "@vue/reactivity";

export default {
  props: {
    val: {
      type: String,
      required: true,
    },
  },
  setup(props,{emit}) {
    const state = reactive({
      value: props.val,
    });

    const change = (event) => {
      emit("update:val", event.target.value);
    };

    return {
      ...toRefs(state),
      change,
    };
  },
};
</script>

<style>
</style>